<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.io.*, java.util.*" %>

<%
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String gender = request.getParameter("gender");
    String member = request.getParameter("member");

    // 设定的账号和密码
    String correctUsername = "admin";
    String correctPassword = "password123";

    if (correctUsername.equals(username) && correctPassword.equals(password)) {
        out.println("<h3>登录成功</h3>");
        if ("yes".equals(member)) {
            out.println("<p>欢迎 " + (gender.equals("male") ? "先生" : "女士") + " 注册为会员</p>");
        }
    } else {
        out.println("<h3>登录失败</h3>");
    }
%>
